package org.momo.rpc.protocol;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Arrays;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RpcRequest implements Serializable {

    /**
     * 调用服务名
     */
    private String serviceName;


    /**
     * 调用服务的版本
     */
    private String serviceVersion;

    /**
     * 调用服务的key
     */
    private String serviceKey;

    /**
     * 调用方法名
     */
    private String methodName;

    /**
     * 参数
     */
    private Object[] params;

    /**
     * 参数类型
     */
    private Class<?>[] paramsClazz;

    @Override
    public String toString() {
        return serviceName + "," + methodName + ","
                + Arrays.toString(params) + ","
                + Arrays.toString(paramsClazz);
    }

}
